<template>
	<view>
		{{ $store.state.name }} -- {{ $store.state.age }}
		
		<button @click="add">点击增加</button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				
			}
		},
		mounted() {
				
				console.log(this.$store.state.name);
		},
		methods: {
			add(){
				this.$store.commit('addAge')
			}
		}
	}
</script>

<style>

</style>
